﻿Public Class Form1
    Public MyFormStartPosition As Point
    Public MyFormDragPosition As Point
    Private Sub MetroPieChart1_MouseDown(sender As Object, e As MouseEventArgs) Handles MetroPieChart1.MouseDown
        If e.Button = Windows.Forms.MouseButtons.Left Then
            MyFormStartPosition = Me.Location
            MyFormDragPosition = Me.PointToScreen(New Point(e.X, e.Y))
        End If
    End Sub
    Private Sub MetroPieChart1_MouseMove(sender As Object, e As MouseEventArgs) Handles MetroPieChart1.MouseMove
        If e.Button = Windows.Forms.MouseButtons.Left Then
            Dim CursorPosition As Point = Me.PointToScreen(New Point(e.X, e.Y))
            Me.Location = New Point(MyFormStartPosition.X + CursorPosition.X - MyFormDragPosition.X, _
              MyFormStartPosition.Y + CursorPosition.Y - MyFormDragPosition.Y)
        End If
    End Sub

    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub MetroCheckBox1_Click(sender As Object, e As EventArgs) Handles MetroCheckBox1.Click
        Dim var As Boolean
        For i = 1 To 5
            If Me.Controls("MetroCheckBox" & i).Text Then

            End If
        Next i
        var = MetroCheckBox1.Checked
        MetroCheckBox1.Text = var
    End Sub
End Class

